//
//  MIDIddxqCell.m
//  迷笛
//
//  Created by . on 2018/9/11.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIddxqCell.h"

@implementation MIDIddxqCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.mainiamge];
        [self.mainiamge mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(WidthScale(17));
            make.left.mas_equalTo(WidthScale(25));
            make.width.mas_equalTo(WidthScale(WidthScale(71)));
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeighX(91):HeightScale(91));
        }];
        
        [self addSubview:self.maintext];
        [self.maintext mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(WidthScale(20));
            make.left.equalTo(self.mainiamge.mas_right).offset(WidthScale(20));
            [self.maintext setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.address];
        [self.address mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.maintext.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.maintext);
            [self.address setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.time];
        [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.address.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.maintext);
            [self.time setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.rmb];
        [self.rmb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.time.mas_bottom).offset(WidthScale(50));
            make.left.mas_offset(WidthScale(25));
            [self.rmb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.price];
        [self.price mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.rmb);
            make.left.equalTo(self.rmb.mas_right).offset(WidthScale(260));
            [self.price setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.payment];
        [self.payment mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(WidthScale(15));
            make.left.mas_offset(WidthScale(25));
            [self.payment setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.goods];
        [self.goods mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.payment.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.payment);
            [self.goods setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.number];
        [self.number mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.goods.mas_bottom).offset(WidthScale(9));
            make.left.equalTo(self.payment);
            [self.number setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.gmtime];
        [self.gmtime mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.number.mas_bottom).offset(WidthScale(9));
            make.left.equalTo(self.number);
            [self.gmtime setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.iphone];
        [self.iphone mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.gmtime.mas_bottom).offset(WidthScale(9));
            make.left.equalTo(self.number);
            [self.iphone setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.state];
        [self.state mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.iphone.mas_bottom).offset(WidthScale(9));
            make.left.equalTo(self.number);
            [self.state setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.cash];
        [self.cash mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.payment);
            make.left.equalTo(self.payment.mas_right).offset(WidthScale(240));
            [self.cash setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.cash2];
        [self.cash2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.goods);
            make.left.equalTo(self.goods.mas_right).offset(WidthScale(240));
            [self.cash2 setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
        
        
    }
    return self;
}
//海报图片
-(UIImageView *)mainiamge
{
    if (!_mainiamge)
    {
        _mainiamge =[[UIImageView alloc]init];
    }
    return _mainiamge;
}
//名称
-(UILabel *)maintext
{
    if (!_maintext)
    {
        _maintext = [[UILabel alloc]init];
        _maintext.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _maintext.font =[UIFont systemFontOfSize:WidthScale(16)];
        _maintext.numberOfLines = 0;
    }
    return _maintext;
}
//地址
-(UILabel *)address
{
    if (!_address)
    {
        _address = [[UILabel alloc]init];
        _address.textColor = [UIColor colorWithHexString:@"#999999"];
        _address.font =[UIFont systemFontOfSize:WidthScale(12)];
        
    }
    return _address;
}
//时间
-(UILabel *)time
{
    if (!_time)
    {
        _time = [[UILabel alloc]init];
        _time.textColor = [UIColor colorWithHexString:@"#999999"];
        _time.font =[UIFont systemFontOfSize:WidthScale(12)];
        
    }
    return _time;
}
//票价
-(UILabel *)rmb
{
    if (!_rmb)
    {
        _rmb = [[UILabel alloc]init];
        _rmb.font =[UIFont systemFontOfSize:WidthScale(15)];
        _rmb.textColor =[UIColor colorWithHexString:@"#999999"];
    }
    return _rmb;
}
-(UILabel *)price
{
    if (!_price)
    {
        _price =[[UILabel alloc]init];
        _price.font =[UIFont systemFontOfSize:WidthScale(15)];
        _price.textColor =[UIColor colorWithHexString:@"#999999"];
    }
    return _price;
}
//cell二
-(UILabel *)payment
{
    if (!_payment)
    {
        _payment =[[UILabel alloc]init];
//        _payment.text = @"付款总额";
        _payment.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _payment.font = [UIFont systemFontOfSize:WidthScale(16)];
    }
    return _payment;
}
-(UILabel *)goods
{
    if (!_goods)
    {
        _goods =[[UILabel alloc]init];
        _goods.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _goods.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _goods;
}
-(UILabel *)number
{
    if (!_number)
    {
        _number =[[UILabel alloc]init];
        _number.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _number.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _number;
}
-(UILabel *)gmtime
{
    if (!_gmtime)
    {
        _gmtime =[[UILabel alloc]init];
        _gmtime.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _gmtime.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _gmtime;
}
-(UILabel *)iphone
{
    if (!_iphone)
    {
        _iphone =[[UILabel alloc]init];
        _iphone.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _iphone.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _iphone;
}
-(UILabel *)state
{
    if (!_state)
    {
        _state =[[UILabel alloc]init];
        _state.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _state.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _state;
}
-(UILabel *)cash
{
    if (!_cash)
    {
        _cash =[[UILabel alloc]init];
        _cash.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _cash.font =[UIFont systemFontOfSize:WidthScale(16)];
    }
    return _cash;
}
-(UILabel *)cash2
{
    if (!_cash2)
    {
        _cash2 =[[UILabel alloc]init];
        _cash2.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _cash2.font =[UIFont systemFontOfSize:WidthScale(14)];
    }
    return _cash2;
}
@end
